Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

242
Vistas
VueJS 3: How to inject JS script into index.html with "Type" as "text/javascript"

I currently build and deploy my VueJS webapp (created via vue3 cli) in a http2 service in aws ec2.

Before deploying, I run npm run build which is package.json as "build": vue-cli-service build

Most of the times, the deployment to aws ec2 is good and webpage loads fine in public internet.

Sometimes, I have following error

Warning: The script from "https:/websitedomain.com/js/chunk-vendors.sdadd234.js" was loaded even though its MIME type ("text/html") is not a valid Javascript MIME type.

Error: Uncaught SyntaxError: expected expression, got '<'

Result

The webpage is blank white page with no data.

Some investigation

Found that Vue injects js and css files into my public/index.html" and when i see "View page source" on blank page, it has code like <script src="/js/chunk-vendors.sdadd234.js">

I am thinking if I can find a way to add "text/javascript" then the page would load just fine.

Has anyone faced this error before? How to solve this problem?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For others that end up in this situation

I did not see this problem any more. Only thing I changed is how the build and deployment stages are in my website development.

Previously

  1. Code changes
  2. npm run serve - to verify everything looks good in local
  3. npm run build and git commit . - This steps is to generate those build files(compressed js, css..) in dist
  4. After git push, my settings in AWS pipelines take care of updating files in dist directory to all my EC2 hosts service the website.

** New process **

  1. Code changes
  2. npm run serve - to verify everything looks good in local
  3. git commit . - No build phase
  4. git push
  5. Now i have update my AWS pipelines to have 3 step process (Code, build and deploy to EC2 hosts)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda